Conversation
Implement the Tile IR print_tko instruction (opcode 85) with a Julia-native
API: standard print() and println() calls inside kernels compile to print_tko
instructions, with format strings built at compile time from mixed constant
string and tile arguments. String interpolation (e.g., println("bid=$bid"))
is supported via a format_string fusion pass that inlines string() args into
print_tko calls.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add PSplat/RSplat support to the rewrite pattern framework: `~x...` captures remaining operands on the LHS and expands them on the RHS. This enables expressing the format_string→print_tko fusion as a single declarative rule instead of an imperative pass: print_tko(format_string(~parts...), ~rest...) => print_tko(~parts..., ~rest...) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Demo:
As opposed to CUDA.jl's
@cuprint, this actually works withStrings in the IR, as well as the standardprintfunctions (though without theIOredirection for now).Julia IR:
Structured IR:
Generated Tile IR:
Fusing the
stringcalls into theprintis done with a rewrite rule.